package com.Day1008;

import java.util.Scanner;

public class Text7 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = 0;
        System.out.println("请输入一串字符串：");
        String str = in.next();
        System.out.println("请输入要查找的字符：");
        String select_str = in.next();
        for (int i = 0; i < str.length(); i++) {

            if (select_str.equals(str.substring(i,i+1))){
                num ++;
            }
        }
        System.out.println(str + "中包含" + num + "个" + select_str);
    }
}
